from django.conf.urls import url
from . import views

# app_name = 'u'
urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^username/(?P<username>[0-9a-zA-Z_-]{5,20})/count$', views.CheckUserNameView.as_view()),
    url(r'^mobile/(?P<mobile>1[3-9]\d{9})/count$', views.CheckMobileView.as_view()),
    url(r'^login/$', views.UserLoginView.as_view(), name='login'),
    url(r'^logout/$', views.UserLogoutView.as_view(), name='logout'),
    url(r'^info/$', views.UserInfoView.as_view(), name='info'),
    url(r'^emails/$', views.EmailView.as_view()),
    url(r'^email_verifications/$', views.ActivateEmailView.as_view()),
    url(r'^addresses/$', views.AddressesView.as_view(), name='addresses'),
    url(r'^addresses/create/$', views.AddressCreateView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.UpdateAddressTitleView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/$', views.UpdateDestroyAddressView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view()),
    url(r'^change_passwd/$', views.ChangePasswordView.as_view(), name='chpasswd'),
    url(r'^browse_histories/$', views.UserBrowseRecordView.as_view()),
]
